package com.helen.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.helen.entity.HomeClassificationEntity;
import com.helen.entity.RecoveryClassEntity;
import com.helen.shopping.R;
import com.helen.utils.MyLog;

import java.util.ArrayList;
import java.util.List;


/**
 * Created by yang on 2017/11/23.
 */

public class HomeClassificationListAdapter extends BaseQuickAdapter<HomeClassificationEntity, BaseViewHolder> {

    public HomeClassificationListAdapter(int layoutResId, List<HomeClassificationEntity> data) {
        super(layoutResId, data);
    }



    @Override
    protected void convert(final BaseViewHolder helper, final HomeClassificationEntity item) {
        try {
            final TextView tvName = (TextView) helper.getView(R.id.tv_home_classification);
            final ImageView imgName = (ImageView) helper.getView(R.id.img_home_classification);
            tvName.setText(item.getName());
            imgName.setImageResource(item.getIcon());
        } catch (Exception e) {
            MyLog.e("yang", "首页分类异常" + e.toString());
        }
    }


}
